package com.avicit.zipkinkafkaesserver.vo;

import com.avicit.zipkinkafkaesserver.utils.TimeUtils;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;

@Data
@Builder
public class RealtimeAvgDurationChartDataVo implements Serializable {

    //时间点
    private Long time;

    //纵坐标值
    private Long reqs;

    //服务
    private String serverName;
    //接口
    private String interfaceName;
    //记录生成时间段的开始时间
    private Long queryStartTime;
    //记录生成时间段的结束时间
    private Long queryEndTime;

    private String queryStartTimeString;
    private String queryEndTimeString;

    public RealtimeAvgDurationChartDataVo setQueryStartTimeString() {
         this.queryStartTimeString = TimeUtils.timestamToDatetime(queryStartTime);
         return this;
    }

    public RealtimeAvgDurationChartDataVo setQueryEndTimeString() {
        this.queryEndTimeString = TimeUtils.timestamToDatetime(queryEndTime);
        return this;
    }

    //平均耗时
    private Long interfaceAverageDuration;

}
